package com.thanhhuy.prisonbreak;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.app.Activity;
import android.view.Menu;
import android.view.WindowManager;

public class PrisonbreakActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		PBGameVars.display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
		super.onCreate(savedInstanceState);
		setContentView(R.layout.splashscreen);
		
		PBGameVars.context = this;
		new Handler().postDelayed(new Thread(){
			@Override
			public void run() {
				Intent mainMenu = new Intent(PrisonbreakActivity.this,PBMainMenu.class);
				PrisonbreakActivity.this.startActivity(mainMenu);
				PrisonbreakActivity.this.finish();
				overridePendingTransition(R.layout.fadein, R.layout.fadeout);
			}
		}, PBGameVars.GAME_THREAD_DELAY);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.prisonbreak, menu);
		return true;
	}

}
